package com.tuyenmonkey.mkloader.model;

import ohos.agp.render.Canvas;
import ohos.agp.utils.RectFloat;

/**
 * Created by Tuyen Nguyen on 2/13/17.
 */

public class Arc extends GraphicObject {
  private RectFloat oval;
  private float startAngle;
  private float sweepAngle;
  private boolean useCenter;
  private ohos.agp.render.Arc mInnerCircleArc;

  public void setOval(RectFloat oval) {
    this.oval = oval;
  }

  public void setStartAngle(float startAngle) {
    this.startAngle = startAngle;
  }

  public void setSweepAngle(float sweepAngle) {
    this.sweepAngle = sweepAngle;
  }

  public void setUseCenter(boolean useCenter) {
    this.useCenter = useCenter;
  }

  public float getStartAngle() {
    return startAngle;
  }

  @Override public void draw(Canvas canvas) {
    mInnerCircleArc = new ohos.agp.render.Arc();
    mInnerCircleArc.setArc( startAngle, sweepAngle, useCenter);
    canvas.drawArc(oval,mInnerCircleArc, paint);
  }
}
